kubectl config set-cluster oldboyedu-linux-groups \
  --certificate-authority=/etc/kubernetes/pki/ca.crt \
  --embed-certs=true \
  --server=https://10.0.0.231:6443 \
  --kubeconfig=oldboyedu-linux.kubeconfig
 
# 设置客户端认证
kubectl config set-credentials oldboyedu \
  --client-key=oldboyedu-groups-key.pem \
  --client-certificate=oldboyedu-groups.pem \
  --embed-certs=true \
  --kubeconfig=oldboyedu-linux.kubeconfig

# 设置默认上下文
kubectl config set-context linux-groups \
  --cluster=oldboyedu-linux-groups \
  --user=oldboyedu \
  --kubeconfig=oldboyedu-linux.kubeconfig

# 设置当前使用的上下文
kubectl config use-context linux-groups --kubeconfig=oldboyedu-linux.kubeconfig
